<?php
session_start();
require_once('style.css');

?>
<body bgcolor="#FFB870">
<?php
include('printstyle.php');
$taal = $_SESSION['taal'];
require_once('pasmy/dbwaarden.php');
include('french.php');
?> 
<h2><div style="text-align: center"><?php echo $dbzoeken[$taal];?></div></h2>

<?php
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);
if(isset($_POST["zoek"])) {
?>
<!-- <font size="5"><strong><a href="index.php" class="linkblue"><div style="text-align: center">Retour</div></a></strong></font> -->
<?php
if(!empty($_POST["AllClients"])) {
	?>
	<table border="1" align="center">
	<?php
	$rowteller = 0;
	$sql = "Select * from clienten";
	$res = mysql_query($sql, $mysql_id);
		while ($row = mysql_fetch_row($res)) 
		{
			if ($rowteller%2 == 1)
    			$klasse = "yellow";
  			else
    			$klasse = "lightblue";
			echo "<tr bgcolor = '$klasse'>";
			echo '<td class = "zones">' . $row[0] . '</td>';
			echo '<td class = "zones">' . $row[2] . '&nbsp;&nbsp;' . $row[3] . '</td>';
			echo '<td class = "zones">' . $row[4] . '&nbsp;&nbsp;' . $row[5] . '</td>';
			echo '<td class = "zones">Tel : ' . $row[6] . '</td>';
			echo '<td class = "zones">Fax : ' . $row[7] . '</td>';
			echo '<td class = "zones">Email : <a href=mailto:' . $row[8] . 'class=email>' . $row[8] . '</a></td>';
			echo '<td class = "zones">TVA : ' . $row[9] . '</td>';
			echo '<td class = "zones">Banque : ' . $row[10] . '</td>';
			echo '<td class = "zones">N&deg; Compte : ' . $row[11] . '</td>';
			echo '<td class = "zones">N&deg; Dossier : ' . $row[12] . '</td>';
			echo '<td class = "zones"><a href="updateClients.php?idnr=' . $row[1]. '" name="updateClient">Update</a></td>';
			echo '</tr>';
			$rowteller++;
		}	
	echo '</table>';
	}
if(!empty($_POST["client"])) {
	?>
	<table border="1" align="center">
	<?php
	$rowteller = 0;
	$sql = "Select * from clienten where client = '$_POST[client]'";
	$res = mysql_query($sql, $mysql_id);
		while ($row = mysql_fetch_row($res)) 
		{
			if ($rowteller%2 == 1)
    			$klasse = "lightblue";
  			else
    			$klasse = "yellow";
			echo "<tr bgcolor = '$klasse'>";
			echo '<td class = "zones">' . $row[0] . '</td>';
			echo '<td class = "zones">' . $row[2] . '&nbsp;&nbsp;' . $row[3] . '</td>';
			echo '<td class = "zones">' . $row[4] . '&nbsp;&nbsp;' . $row[5] . '</td>';
			echo '<td class = "zones">Tel : ' . $row[6] . '</td>';
			echo '<td class = "zones">Fax : ' . $row[7] . '</td>';
			echo '<td class = "zones">Email : <a href=mailto:' . $row[8] . 'class=email>' . $row[8] . '</a></td>';
			echo '<td class = "zones">TVA : ' . $row[9] . '</td>';
			echo '<td class = "zones">Banque : ' . $row[10] . '</td>';
			echo '<td class = "zones">N&deg; Compte : ' . $row[11] . '</td>';
			echo '<td class = "zones">N&deg; Dossier : ' . $row[12] . '</td>';
			echo '<td class = "zones"><a href="updateClients.php?idnr=' . $row[1]. '" name="updateClient">Update</a></td>';
			echo '</tr>';
			$rowteller++;
		}	
	echo '</table>';
}
?>
<br /><font size="5"><strong><a href="index.php" class="linkblue"><div style="text-align: center">Retour</div></a></strong></font>
<?php
exit();
}
?>


<br /><br />
 
<form action="zoeken4.php" method="POST">
<table width="20%" align="center" border="0">
<tr>
<td><input type="checkbox" name="AllClients" value="allclients" /> Voir tous les Clients</td>
</tr>
<tr><td></td></tr>
<tr><td>&nbsp;</td></tr>
<?php
$chtel=1;
$clienteel[0] = "";
$sql = "select client from clienten";
$res = mysql_query($sql, $mysql_id);
	$fout = mysql_errno($mysql_id);
	if ($fout != 0) {
		echo "<font size='+2' color='#FF0000'>" . mysql_errno($mysql_id) . ": " . mysql_error($mysql_id) . "\n" . "</font>";
		mysql_close($mysql_id);
		echo '</body></html>';
		exit;
		}
else {
	while ($row = mysql_fetch_row($res)) 
	{
		$clienteel[$chtel]=$row[0];
		$chtel++;
	}
asort($clienteel);
}
?>
<tr><td>
<select name="client">
<?php
while(list($key, $val)=each($clienteel)) {
	if (isset($client) && ($client == $val)) {
		echo '<option value="'.$val.'" selected>'.$val.'</option>';
	} else {
		echo '<option value="'.$val.'">'.$val.'</option>';
	}
}
?></select>

</td></tr>
<tr>
<td><br /><input type="submit" name="zoek" value="Chercher" /></td>
</tr>
</table>
</form>


<font size="5"><strong><a href="index.php" class="linkblue"><div style="text-align: center">Retour</div></a></strong></font>
</body>